#include <livox_m.h>
#include <LdPcl.h>

int main()
{
    LdsLidar &mylidar = LdsLidar::GetInstance();
    std::vector<std::string> BroadCode;
    // char saved_path[100];
    // std::string saved;
    // BroadCode.push_back("000000000000001");
    BroadCode.push_back("3WEDH7600110891");
    mylidar.InitLdsLidar(BroadCode, 24000);
    // mylidar.InitLdsLidar("auto", 100);
    sleep(1);
    pcl::visualization::CloudViewer viewer("Viewer");
    int i = 0;

    while (!viewer.wasStopped())
    {
        std::vector<Gydata> Gys;
        std::vector<PcloudI> Clouds;
        std::vector<PcloudI> Clouds;
        for (size_t i = 0; i < 5; i++)
        {
            Gys.resize(5);
            Clouds.resize(5);
            PcloudI tempCloud(new CloudI());
            Gydata tempGy;
            mylidar.getdata(tempCloud, tempGy);
            Clouds.push_back(tempCloud);
            Gys.push_back(tempGy);
        }
    }
}